

var productId = getQuery("productId");


window.onload =function (){
    showProduct();
}


function showProduct(){
    axios.get("/product/findById",{
        params:{
            productId
        }
    }).then(e=>{
        var info = e.data;
        $("id").innerHTML=info.id;
        $("name").innerHTML=info.name;
        $("price").innerHTML=info.price;
        $("madeIn").innerHTML=info.madeIn;
        $("date").innerHTML=info.date;
        $("sum").innerHTML=info.sum;
        $("img").src = "/productImg/" +info.img;
    })
}



 function  buy(){
 axios.get("/custom/shop/buy",{
        params:{
            productId
        }
    }).then(e =>{
        if (e.data=="ok"){
            location.href="/custom/shop.html"

        }
    })

}

function  returnS(){
    location.href="/index.html"
}